// 采购记录
var procColumns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'name',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'nmsg',
  title: '品名及规格',
  width: 200,
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '预计金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '备注',
  type: 'string',
  columnClass: 'text-left',
}, ];
var procOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产信息',
  datas: [{
    no: '1',
    list: '硬件',
    type: '笔记本',
    name: '华硕办公笔记本',
    nmsg: 'i5CPU 8G内存 256内存',
    size: '999999999',
    price: '￥999,999,999.99元',
    msg: '备注测试数据',
  }, ],
  columns: procColumns,
  gridContainer: 'procContainer',
  toolbarContainer: 'procToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var procGrid = $.fn.dlshouwen.grid.init(procOption);
$(function () {
  procGrid.load();
});

// 单个采购申请 or 批量申请
var procTlColumns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'name',
  title: '名称',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'nmsg',
  title: '品名及规格',
  width: 200,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'size',
  title: '数量',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '预计金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '备注',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 220,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-primary" onclick="hdplog();"><i class="icon-eye-open"></i>  报价历史库</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-success" onclick=""><i class="icon-eye-open"></i>  报价</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="shgs();"><i class="icon-plus"></i>  报价</button>';
    return content;
  }
}];
var procTlOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产信息',
  datas: [{
    no: '1',
    list: '硬件',
    type: '笔记本',
    name: '华硕办公笔记本',
    nmsg: 'i5CPU 8G内存 256内存',
    size: '999999999',
    price: '￥999,999,999.99元',
    msg: '备注测试数据',
  }, ],
  columns: procTlColumns,
  gridContainer: 'procTlContainer',
  toolbarContainer: 'procTlToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var procTlGrid = $.fn.dlshouwen.grid.init(procTlOption);
$(function () {
  procTlGrid.load();
});

function hdplog(){
  $(".hdplog").show();
}

// 供应商报价历史库
var prcLogColumns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
},  {
  id: 'pl1',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pl2',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'plname',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'p2',
  title: '供应商名称',
  // width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '联系方式',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
},
{
  id: 'p4',
  title: '规格(参数)',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p5',
  title: '价格(说明)',
  // width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '价格(含税)',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '交货期',
  width: 80,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p8',
  title: '质保期',
  width: 70,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p9',
  title: '付款方式',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p10',
  title: '优劣势',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  附件</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  协议</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-info" onclick="shgs();"><i class="icon-plus"></i>  报价</button>';
    return content;
  }
}
];
var prcLogOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产信息',
  datas: [{
    id: 1,
    no: '1',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  },{
    id: 2,
    no: '2',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, ],
  columns: prcLogColumns,
  gridContainer: 'prcLogContainer',
  toolbarContainer: 'prcLogToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var prcLogGrid = $.fn.dlshouwen.grid.init(prcLogOption);
$(function () {
  prcLogGrid.load();
});


// 供应商报价历史库文件下载
function pDowload(id) {
  if(id == 1){
    layer.msg("抱歉，没有文件可供查看下载！");
  }else{
    //页面层
    layer.open({
      type: 1,
      skin: 'layui-layer-rim', //加上边框
      area: ['480px', 'auto'], //宽高
      title: '文件下载列表',
      content: '<div class="aper-layer">' +
        '<table class="table table-bordered" style="text-align: center;margin-bottom:0;">' +
        '<thead>' +
        '<tr><th>文件名称</th><th>版本号</th><th>上传时间</th><th>操作</th></tr>' +
        '</thead>' +
        '<tbody>' +
        '<tr><td>文件名称测试数据</td><td>v1.0</td><td>2019-02-03 13:00:21</td><td><a href="" download="">下载</a></td></tr>' +
        '</tbody>' +
        '</table>' +
        '</ul>' +
        '</div>'
    });
  }
}



// 供应商报价列表
var prcListColumns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
},  {
  id: 'pl1',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pl2',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'plname',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'p1',
  title: '地点',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p2',
  title: '供应商名称',
  // width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '联系方式',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, 
{
  id: 'p4',
  title: '规格(参数)',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p5',
  title: '价格(说明)',
  // width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '价格(含税)',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '交货期',
  width: 80,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p8',
  title: '质保期',
  width: 74,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p9',
  title: '付款方式',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p10',
  title: '优劣势',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'operation',
  title: '操作',
  width: 240,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="shproc(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-success" onclick="shupload();"><i class="icon-cloud-upload"></i>  附件</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-primary" onclick="pDowload(' + record.id + ')"><i class="icon-eye-open"></i>  附件</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}
];
var prcListOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产信息',
  datas: [{
    id: 1,
    no: '1',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, {
    id: 2,
    no: '2',
    pl1: '硬件',
    pl2: '服务器',
    plname: '浪潮服务器',
    p1: '北京',
    p2: '北京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, ],
  columns: prcListColumns,
  gridContainer: 'prcListContainer',
  toolbarContainer: 'prcListToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var prcListGrid = $.fn.dlshouwen.grid.init(prcListOption);
$(function () {
  prcListGrid.load();
});

function hdupload(){
  $(".hdupload").hide();
}

function shupload(){
  $(".hdupload").show();
}


// 资产库借货记录
var libraryColumns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'no',
  title: '资产编号',
  width: 170,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'status',
  title: '状态',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gname',
  title: '归属人',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gpro',
  title: '归属项目',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'address',
  title: '放置地',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, ];
var libraryOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产库借货信息',
  datas: [{
    id: 1,
    number: '1',
    no: 'NJSTS20180102180222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    status: '闲置',
    gname: '张三',
    gpro: '中国移动',
    address: '南京'
  }, ],
  columns: libraryColumns,
  gridContainer: 'libraryContainer',
  toolbarContainer: 'libraryToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var libraryGrid = $.fn.dlshouwen.grid.init(libraryOption);
$(function () {
  libraryGrid.load();
});

// 采购记录-编辑
var proc1Columns = [{
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'size',
  title: '数量',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '预计金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="shproc(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var proc1Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产信息',
  datas: [{
    list: '硬件',
    type: '笔记本',
    size: '999999999',
    price: '￥999,999,999.99元',
    msg: '资产描述测试数据',
  }, ],
  columns: proc1Columns,
  gridContainer: 'proc1Container',
  toolbarContainer: 'proc1ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var proc1Grid = $.fn.dlshouwen.grid.init(proc1Option);
$(function () {
  proc1Grid.load();
});

// 资产库借货记录-编辑
var library1Columns = [{
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'no',
  title: '资产编号',
  width: 170,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'status',
  title: '状态',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gname',
  title: '归属人',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gpro',
  title: '归属项目',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'address',
  title: '放置地',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="zdbox(' + record.id + ');"><i class="fa fa-edit"></i>  转移</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var library1Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产库借货信息',
  datas: [{
    id: 1,
    no: 'NJSTS20180102180222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    status: '闲置',
    gname: '张三',
    gpro: '中国移动',
    address: '南京'
  }, ],
  columns: library1Columns,
  gridContainer: 'library1Container',
  toolbarContainer: 'library1ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var library1Grid = $.fn.dlshouwen.grid.init(library1Option);
$(function () {
  library1Grid.load();
});

// 显示隐藏采购表单
function shproc() {
  $('.hdproc').show();
}

function hdproc() {
  $('.hdproc').hide();
}

// 资产库可用资产信息
var lidColumns = [{
  id: 'no',
  title: '资产编号',
  width: 170,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'address',
  title: '放置地',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="borrow(' + record.id + ');"><i class="icon-hand-right"></i>  申请</button>';
    return content;
  }
}];
var lidOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产库可用资产信息',
  datas: [{
    no: 'NJSTS20190102123111',
    gname: '张三',
    gpro: '中国移动',
    address: '南京',
    msg: '资产描述测试数据'
  }, ],
  columns: lidColumns,
  gridContainer: 'lidContainer',
  toolbarContainer: 'lidToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var lidGrid = $.fn.dlshouwen.grid.init(lidOption);
$(function () {
  lidGrid.load();
});

function zdbox(id) {
  layer.confirm('确认申请转换此资源？', {
    btn: ['确认', '取消'] //按钮
  }, function () {
    layer.msg('申请成功', {
      icon: 1
    });
  });
}

// 借货申请
function borrow(id) {
  layer.confirm('是否确认申请此资源？', {
    title: '提示信息',
    btn: ['确认', '取消'] //按钮
  }, function () {
    layer.msg('申请成功', {
      icon: 1
    });
  });
}

// 采购比价单信息
var priceColumns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'name',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'nmsg',
  title: '品名及规格',
  width: 200,
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '预计金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '备注',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 70,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-primary" onclick="selprice(' + record.id + ');"><i class="icon-eye-open"></i>  查看</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var priceOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '采购比价单列表信息',
  datas: [{
    no: '1',
    list: '硬件',
    type: '笔记本',
    name: '华硕办公笔记本',
    nmsg: 'i5CPU 8G内存 256内存',
    size: '12',
    price: '￥2222.99元',
    msg: '备注测试数据',
  }, ],
  columns: priceColumns,
  gridContainer: 'priceContainer',
  toolbarContainer: 'priceToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var priceGrid = $.fn.dlshouwen.grid.init(priceOption);
$(function () {
  priceGrid.load();
});



// 采购比价单信息
var pryslColumns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p1',
  title: '供应商名称',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p2',
  title: '名称',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '规格(参数)',
  // width: 200,
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p4',
  title: '单位',
  width: 54,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p5',
  title: '实收数量',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '采购单位验收',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '验收单位验收',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p8',
  title: '备注',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs'
}, {
  id: 'operation',
  title: '操作',
  width: 70,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" data-toggle="modal" href="#myModal" onclick=""><i class="icon-ok"></i>  验收</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var pryslOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  check : true,
  checkWidth : 20,
  exportFileName: '供应商列表',
  datas: [{
    no: '1',
    p1: '山东巨泰数据信息技术有限公司',
    p2: '思科交换机DS-C9148S-D12P8K9',
    p3: '24个千兆电口,4个1GSFP光纤接口、局域网基础版,支持可堆叠,配套1堆叠模块,0.5m堆叠线缆',
    p4: '台',
    p5: '2',
    p6: '合格',
    p7: '合格',
    p8: '固定资产编号',
  }, ],
  columns: pryslColumns,
  gridContainer: 'pryslContainer',
  toolbarContainer: 'pryslToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var pryslGrid = $.fn.dlshouwen.grid.init(pryslOption);
$(function () {
  pryslGrid.load();
});

function pryslGridCheckedRecordsLength(){
	var recordCount = pryslGrid.getCheckedRecords().length;
	if(recordCount <= 0){
    layer.msg("请至少勾选一条数据！");
  }else{
    console.log(recordCount); 
    $('#mySodal').modal();
  }
}

// 供应商列表
var gyslColumns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p1',
  title: '供应商名称',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p2',
  title: '名称',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '规格(参数)',
  // width: 200,
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p4',
  title: '单位',
  width: 54,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p5',
  title: '实收数量',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '采购单位验收',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '验收单位验收',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p8',
  title: '备注',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs'
}, {
  id: 'operation',
  title: '操作',
  width: 160,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="shupload();"><i class="icon-plus"></i>  资产入库</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-primary" onclick="pDowload('+ record.id +')"><i class="icon-eye-open"></i>  验收单</button>';
    return content;
  }
}];
var gyslOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  // check : true,
  // checkWidth : 20,
  exportFileName: '供应商列表',
  datas: [{
    no: '1',
    p1: '山东巨泰数据信息技术有限公司',
    p2: '思科交换机DS-C9148S-D12P8K9',
    p3: '24个千兆电口,4个1GSFP光纤接口、局域网基础版,支持可堆叠,配套1堆叠模块,0.5m堆叠线缆',
    p4: '台',
    p5: '2',
    p6: '合格',
    p7: '合格',
    p8: '固定资产编号',
  }, ],
  columns: gyslColumns,
  gridContainer: 'gyslContainer',
  toolbarContainer: 'gyslToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var gyslGrid = $.fn.dlshouwen.grid.init(gyslOption);
$(function () {
  gyslGrid.load();
});

// 采购清单
var pslColumns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'name',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'nmsg',
  title: '品名及规格',
  width: 200,
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '预计金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '备注',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 60,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-primary" onclick="selprice(' + record.id + ');"><i class="icon-eye-open"></i>  查看</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var pslOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '采购比价单列表信息',
  datas: [{
    no: '1',
    list: '硬件',
    type: '笔记本',
    name: '华硕办公笔记本',
    nmsg: 'i5CPU 8G内存 256内存',
    size: '12',
    price: '￥2222.99元',
    msg: '备注测试数据',
  }, {
    no: '2',
    list: '硬件',
    type: '笔记本',
    name: '华硕办公笔记本',
    nmsg: 'i5CPU 8G内存 256内存',
    size: '12',
    price: '￥2222.99元',
    msg: '备注测试数据',
  }, ],
  columns: pslColumns,
  gridContainer: 'pslContainer',
  toolbarContainer: 'pslToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var pslGrid = $.fn.dlshouwen.grid.init(pslOption);
$(function () {
  pslGrid.load();
});


// 历史报价库
var pricelogColumns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
},  {
  id: 'pl1',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pl2',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'plname',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'p2',
  title: '供应商名称',
  // width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '联系方式',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
},
{
  id: 'p4',
  title: '规格(参数)',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p5',
  title: '价格(说明)',
  // width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '价格(含税)',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '交货期',
  width: 80,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p8',
  title: '质保期',
  width: 70,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p9',
  title: '付款方式',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p10',
  title: '优劣势',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  附件</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  协议</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-info" onclick="shgs();"><i class="icon-plus"></i>  报价</button>';
    return content;
  }
}];
var pricelogOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '历史报价库',
  datas: [{
    id: 1,
    no: '1',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  },{
    id: 2,
    no: '2',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, ],
  columns: pricelogColumns,
  gridContainer: 'pricelogContainer',
  toolbarContainer: 'pricelogToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var pricelogGrid = $.fn.dlshouwen.grid.init(pricelogOption);
$(function () {
  pricelogGrid.load();
});

// 供应商列表
var supplier01Columns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
},  {
  id: 'p1',
  title: '地点',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'pl1',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pl2',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'plname',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'p2',
  title: '供应商名称',
  // width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '联系方式',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, 
{
  id: 'p4',
  title: '规格(参数)',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p5',
  title: '价格(说明)',
  // width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '价格(含税)',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '交货期',
  width: 80,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p8',
  title: '质保期',
  width: 74,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p9',
  title: '付款方式',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p10',
  title: '优劣势',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'operation',
  title: '操作',
  width: 60,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  附件</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  协议</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-info" onclick="shgs();"><i class="icon-plus"></i>  报价</button>';
    return content;
  }
}];
var supplier01Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '供应商列表',
  datas: [{
    id: 1,
    no: '1',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, {
    id: 2,
    no: '2',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '浪潮服务器',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, ],
  columns: supplier01Columns,
  gridContainer: 'supplier01Container',
  toolbarContainer: 'supplier01ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var supplier01Grid = $.fn.dlshouwen.grid.init(supplier01Option);
$(function () {
  supplier01Grid.load();
});


// 供应商列表
var supplier02Columns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
},  {
  id: 'p1',
  title: '地点',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'pl1',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pl2',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'plname',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'p2',
  title: '供应商名称',
  // width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '联系方式',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, 
{
  id: 'p4',
  title: '规格(参数)',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p5',
  title: '价格(说明)',
  // width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '价格(含税)',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pyz',
  title: '申请用印',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '交货期',
  width: 80,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p8',
  title: '质保期',
  width: 74,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p9',
  title: '付款方式',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p10',
  title: '优劣势',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="shupload();"><i class="icon-cloud-upload"></i>  协议</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  附件</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-info" onclick="shgs();"><i class="icon-plus"></i>  报价</button>';
    return content;
  }
}];
var supplier02Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '供应商列表',
  datas: [{
    id: 1,
    no: '1',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    pyz: '否',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, {
    id: 2,
    no: '2',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '浪潮服务器',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    pyz: '是',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, ],
  columns: supplier02Columns,
  gridContainer: 'supplier02Container',
  toolbarContainer: 'supplier02ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var supplier02Grid = $.fn.dlshouwen.grid.init(supplier02Option);
$(function () {
  supplier02Grid.load();
});


// 供应商列表
var supplier03Columns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
},  {
  id: 'p1',
  title: '地点',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'pl1',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pl2',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'plname',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'p2',
  title: '供应商名称',
  // width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '联系方式',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, 
{
  id: 'p4',
  title: '规格(参数)',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p5',
  title: '价格(说明)',
  // width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '价格(含税)',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pyz',
  title: '申请用印',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '交货期',
  width: 80,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p8',
  title: '质保期',
  width: 74,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p9',
  title: '付款方式',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p10',
  title: '优劣势',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  附件</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  协议</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-info" onclick="shgs();"><i class="icon-plus"></i>  报价</button>';
    return content;
  }
}];
var supplier03Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '供应商列表',
  datas: [{
    id: 2,
    no: '1',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    pyz: '是',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, {
    id: 2,
    no: '2',
    pl1: '硬件',
    pl2: '服务器',
    plname: '浪潮服务器',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    pyz: '是',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, ],
  columns: supplier03Columns,
  gridContainer: 'supplier03Container',
  toolbarContainer: 'supplier03ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var supplier03Grid = $.fn.dlshouwen.grid.init(supplier03Option);
$(function () {
  supplier03Grid.load();
});


// 供应商列表——协议确认已用印？
var supplier04Columns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
},  {
  id: 'p1',
  title: '地点',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'pl1',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pl2',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'plname',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'p2',
  title: '供应商名称',
  // width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '联系方式',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, 
{
  id: 'p4',
  title: '规格(参数)',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p5',
  title: '价格(说明)',
  // width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '价格(含税)',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pyz',
  title: '确认用印',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '交货期',
  width: 80,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p8',
  title: '质保期',
  width: 74,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p9',
  title: '付款方式',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p10',
  title: '优劣势',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'operation',
  title: '操作',
  width: 220,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  附件</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  协议</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-success" onclick="qryy();"><i class="icon-legal"></i>  确认用印</button>';
    return content;
  }
}];
var supplier04Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '供应商列表',
  datas: [{
    id: 2,
    no: '1',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    pyz: '已用印',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, {
    id: 2,
    no: '2',
    pl1: '硬件',
    pl2: '服务器',
    plname: '浪潮服务器',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    pyz: '未用印',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, ],
  columns: supplier04Columns,
  gridContainer: 'supplier04Container',
  toolbarContainer: 'supplier04ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var supplier04Grid = $.fn.dlshouwen.grid.init(supplier04Option);
$(function () {
  supplier04Grid.load();
});


// 供应商列表用印结束 归档确认
var supplier05Columns = [{
  id: 'no',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
},  {
  id: 'p1',
  title: '地点',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'pl1',
  title: '类目',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pl2',
  title: '类别',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'plname',
  title: '名称',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'p2',
  title: '供应商名称',
  // width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '联系方式',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, 
{
  id: 'p4',
  title: '规格(参数)',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p5',
  title: '价格(说明)',
  // width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '价格(含税)',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'pyz',
  title: '确认用印',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'p7',
  title: '交货期',
  width: 80,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p8',
  title: '质保期',
  width: 74,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'p9',
  title: '付款方式',
  width: 100,
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, 
{
  id: 'p10',
  title: '优劣势',
  type: 'string',
  columnClass: 'text-left',
  hideType:'lg|md|sm|xs',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  附件</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="pDowload('+ record.id +')"><i class="icon-cloud-download"></i>  协议</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-success" onclick="qryy();"><i class="icon-legal"></i>  确认用印</button>';
    return content;
  }
}];
var supplier05Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '供应商列表',
  datas: [{
    id: 2,
    no: '1',
    pl1: '硬件',
    pl2: '笔记本',
    plname: '华硕办公笔记本',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    pyz: '已用印',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, {
    id: 2,
    no: '2',
    pl1: '硬件',
    pl2: '服务器',
    plname: '浪潮服务器',
    p1: '南京',
    p2: '南京市创瑞丰系统集成有限公司',
    p3: '12345678901',
    p4: '规格(参数)测试数据',
    p5: '单价：1450元/块，数量：10块',
    p6: '￥999,999,999.00元',
    pyz: '已用印',
    p7: '5个工作日',
    p8: '三年质保',
    p9:'票到60天付款',
    p10: '该供应商为我司长期合作供应商，一直为我司提供浪潮服务器及其配件，质量相对有保障，且价格相对其他两家较低。'
  }, ],
  columns: supplier05Columns,
  gridContainer: 'supplier05Container',
  toolbarContainer: 'supplier05ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var supplier05Grid = $.fn.dlshouwen.grid.init(supplier05Option);
$(function () {
  supplier05Grid.load();
});


// 确认用印
function qryy(){
  //询问框
  layer.confirm('确认该供货协议已用印？', {
    title: '提示信息',
    btn: ['确认', '取消'] //按钮
  }, function () {
    layer.msg('确认成功', {
      icon: 1
    });
  });
}


// 确认采购
function onsel(id) {
  //询问框
  layer.confirm('确认采购此供应商报价产品？', {
    title: '提示信息',
    btn: ['确认', '取消'] //按钮
  }, function () {
    layer.msg('确认成功', {
      icon: 1
    });
  });
}

// 撤销采购
function tal(id) {
  //询问框
  layer.confirm('撤销采购此供应商报价产品？', {
    title: '提示信息',
    btn: ['确认', '取消'] //按钮
  }, function () {
    layer.msg('撤销成功', {
      icon: 1
    });
  });
}

// 供应商列表
var supplier3Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '总金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'a',
  title: '拆分单件',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'abuy',
  title: '供货商',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'tel',
  title: '经办人',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 60,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  报价文件</button>';
    content += '  ';
    // content += '<button class="btn btn-xs btn-success" onclick="onsel(' + record.id + ');"><i class="icon-hand-up"></i>  确认采购</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-danger" onclick="tal(' + record.id + ');"><i class="icon-reply"></i>  撤销采购</button>';
    return content;
  }
}];
var supplier3Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '供应商列表',
  datas: [{
    number: '1',
    // cno: 'NJSTS20180102192222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述',
    size: '12',
    price: '￥2222.99元',
    a: '12',
    abuy: '联想',
    tel: '张三',
  }, ],
  columns: supplier3Columns,
  gridContainer: 'supplier3Container',
  toolbarContainer: 'supplier3ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var supplier3Grid = $.fn.dlshouwen.grid.init(supplier3Option);
$(function () {
  supplier3Grid.load();
});



// 供应商列表
var supplier2Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '总金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'a',
  title: '拆分单件',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'abuy',
  title: '供货商',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'tel',
  title: '经办人',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 70,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  报价文件</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var supplier2Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '供应商列表',
  datas: [{
    number: '1',
    // cno: 'NJSTS20180102192222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述',
    size: '12',
    price: '￥2222.99元',
    a: '12',
    abuy: '联想',
    tel: '张三',
  }, ],
  columns: supplier2Columns,
  gridContainer: 'supplier2Container',
  toolbarContainer: 'supplier2ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var supplier2Grid = $.fn.dlshouwen.grid.init(supplier2Option);
$(function () {
  supplier2Grid.load();
});


//文件下载权限事件
function down(id) {
  //询问框
  layer.confirm('权限不足，是否申请更高权限？', {
    title: '提示信息',
    btn: ['申请', '取消'] //按钮
  }, function () {
    layer.msg('申请成功', {
      icon: 1
    });
  });
}

function selprice(id) {
  $('.hdlog').show();
  $('.hdgbuy').show();
}

// 采购比价单信息
var price1Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 54,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '预计金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, ];
var price1Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '采购比价单列表信息',
  datas: [{
    number: '1',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    size: '12',
    price: '￥2222.99元'
  }, ],
  columns: price1Columns,
  gridContainer: 'price1Container',
  toolbarContainer: 'price1ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var price1Grid = $.fn.dlshouwen.grid.init(price1Option);
$(function () {
  price1Grid.load();
});

// 供应商列表
var supplier1Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '总金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'a',
  title: '拆分单件',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'abuy',
  title: '供货商',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'tel',
  title: '经办人',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 70,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  报价文件</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var supplier1Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '供应商列表',
  datas: [{
    number: '1',
    // cno: 'NJSTS20180102192222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述',
    size: '12',
    price: '￥2222.99元',
    a: '12',
    abuy: '联想',
    tel: '张三',
  }, ],
  columns: supplier1Columns,
  gridContainer: 'supplier1Container',
  toolbarContainer: 'supplier1ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var supplier1Grid = $.fn.dlshouwen.grid.init(supplier1Option);
$(function () {
  supplier1Grid.load();
});

// 采购管理明细
var cgglColumns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '名称',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '品名及规格',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '单位',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'size',
  title: '单价',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '数量',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'a',
  title: '需求日期',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'abuy',
  title: '预估金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'tel',
  title: '备注',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick=""><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var cgglOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '采购管理明细',
  datas: [{
    number: '1',
    list: '笔记本',
    type: 'i5 4G 256G',
    msg: '台',
    size: '￥2222.99元',
    price: '12',
    a: '2018/01/02',
    abuy: '￥2222.99元',
    tel: '张三',
  }, ],
  columns: cgglColumns,
  gridContainer: 'cgglContainer',
  toolbarContainer: 'cgglToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var cgglGrid = $.fn.dlshouwen.grid.init(cgglOption);
$(function () {
  cgglGrid.load();
});

function hdcg() {
  $('.hdcg').hide();
}

function shcg() {
  $('.hdcg').show();
}


// 采购管理明细-待办流程
var cggl1Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '名称',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '品名及规格',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '单位',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'size',
  title: '单价',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '数量',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'a',
  title: '需求日期',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'abuy',
  title: '预估金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'tel',
  title: '备注',
  type: 'string',
  columnClass: 'text-left',
}, ];
var cggl1Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '采购管理明细',
  datas: [{
    number: '1',
    list: '笔记本',
    type: 'i5 4G 256G',
    msg: '台',
    size: '￥2222.99元',
    price: '12',
    a: '2018/01/02',
    abuy: '￥2222.99元',
    tel: '张三',
  }, ],
  columns: cggl1Columns,
  gridContainer: 'cggl1Container',
  toolbarContainer: 'cggl1ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var cggl1Grid = $.fn.dlshouwen.grid.init(cggl1Option);
$(function () {
  cggl1Grid.load();
});


// 采购列表
var pclistColumns = [{
    id: 'number',
    title: '序号',
    width: 50,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'no',
    title: '采购单编号',
    width: 170,
    type: 'string',
    columnClass: 'text-center',
  },
  // {
  //   id: 'type',
  //   title: '采购类型',
  //   width: 120,
  //   type: 'string',
  //   columnClass: 'text-center',
  // },
  {
    id: 'pname',
    title: '项目名称',
    width: 150,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'name',
    title: '申请人',
    width: 73,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'time',
    title: '申请时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'msg',
    title: '申请说明',
    type: 'string',
    columnClass: 'text-left',
  }, {
    id: 'operation',
    title: '操作',
    width: 70,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-primary" onclick="selproc(' + record.id + ');"><i class="icon-eye-open"></i>  查看</button>';
      return content;
    }
  }
];
var pclistOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '采购列表',
  datas: [{
    id: 1,
    number: '1',
    no: 'NJSTS20180102192910',
    pname: '项目名称测试数据A',
    name: '张三',
    time: '2019/01/02',
    msg: '申请说明测试数据'
  }, ],
  columns: pclistColumns,
  gridContainer: 'pclistContainer',
  toolbarContainer: 'pclistToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var pclistGrid = $.fn.dlshouwen.grid.init(pclistOption);
$(function () {
  pclistGrid.load();
});

// 查看采购信息
function selproc(id) {
  if (id == 1) {
    window.location.href = "../../do/sel/sel-proc.html" + '?id=' + id;
  }
  if (id == 2) {
    window.location.href = "../../do/sel/sel-proc-2.html" + '?id=' + id;
  }
  if (id == 3) {
    window.location.href = "../../do/sel/sel-proc-3.html" + '?id=' + id;
  }
  if (id == 4) {
    window.location.href = "../../do/sel/sel-proc-4.html" + '?id=' + id;
  }
  if (id == 5) {
    window.location.href = "../../do/sel/sel-proc-5.html" + '?id=' + id;
  }
}



// 采购清单
var cggsColumns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 54,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '预计金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="selprice(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var cggsOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '采购比价单列表信息',
  datas: [{
    number: '1',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    size: '12',
    price: '￥2222.99元'
  }, ],
  columns: cggsColumns,
  gridContainer: 'cggsContainer',
  toolbarContainer: 'cggsToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var cggsGrid = $.fn.dlshouwen.grid.init(cggsOption);
$(function () {
  cggsGrid.load();
});

// 采购清单
var cggs1Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 54,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '预计金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, ];
var cggs1Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '采购比价单列表信息',
  datas: [{
    number: '1',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    size: '12',
    price: '￥2222.99元'
  }, ],
  columns: cggs1Columns,
  gridContainer: 'cggs1Container',
  toolbarContainer: 'cggs1ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var cggs1Grid = $.fn.dlshouwen.grid.init(cggs1Option);
$(function () {
  cggs1Grid.load();
});

// 供应商报价
var gpuyColumns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '总金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'a',
  title: '拆分单件',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'abuy',
  title: '供货商',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'tel',
  title: '经办人',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="edit(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var gpuyOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '供应商列表',
  datas: [{
    number: '1',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述',
    size: '12',
    price: '￥2222.99元',
    a: '12',
    abuy: '联想',
    tel: '张三',
  }, ],
  columns: gpuyColumns,
  gridContainer: 'gpuyContainer',
  toolbarContainer: 'gpuyToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var gpuyGrid = $.fn.dlshouwen.grid.init(gpuyOption);
$(function () {
  gpuyGrid.load();
});

function hdgs() {
  $('.hdgs').hide();
}

function shgs() {
  $('.hdgs').show();
}

// 采购清单-待办102
var proc3Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'name',
  title: '名称',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'nmsg',
  title: '品名及规格',
  width: 200,
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 54,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '预计金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '备注',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" data-toggle="modal" href="#myModal"><i class="icon-retweet"></i>  调配资产</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-success" onclick="shproc(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var proc3Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产信息',
  datas: [{
    number: '1',
    list: '硬件',
    type: '笔记本',
    name: '华硕办公笔记本',
    nmsg: 'i5CPU 8G内存 256内存',
    size: '999',
    price: '￥999,999,999.99元',
    msg: '备注测试数据',
  }, ],
  columns: proc3Columns,
  gridContainer: 'proc3Container',
  toolbarContainer: 'proc3ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var proc3Grid = $.fn.dlshouwen.grid.init(proc3Option);
$(function () {
  proc3Grid.load();
});

// 资产库借货列表
var library2Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'no',
  title: '资产编号',
  width: 170,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'status',
  title: '状态',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gname',
  title: '归属人',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gpro',
  title: '归属项目',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'address',
  title: '放置地',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 70,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    // content += '<button class="btn btn-xs btn-info" onclick="zdbox(' + record.id + ');"><i class="fa fa-edit"></i>  转移</button>';
    // content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var library2Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产库借货信息',
  datas: [{
    id: 1,
    number: '1',
    no: 'NJSTS20180102180222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    status: '闲置',
    gname: '张三',
    gpro: '中国移动',
    address: '南京'
  }, ],
  columns: library2Columns,
  gridContainer: 'library2Container',
  toolbarContainer: 'library2ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var library2Grid = $.fn.dlshouwen.grid.init(library2Option);
$(function () {
  library2Grid.load();
});

// 个人资产申请，资产管理员调配资产库操作页面
var library31Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'no',
  title: '资产编号',
  width: 170,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'status',
  title: '状态',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gname',
  title: '归属人',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gpro',
  title: '归属项目',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'address',
  title: '放置地',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 70,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="tpeople(' + record.id + ');"><i class="fa fa-edit"></i>  转移</button>';
    content += '  ';
    // content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var library31Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '申请清单',
  datas: [{
    id: 1,
    number: '1',
    no: 'NJSTS20180102180222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    status: '闲置',
    gname: '张三',
    gpro: '中国移动',
    address: '南京'
  }, ],
  columns: library31Columns,
  gridContainer: 'library31Container',
  toolbarContainer: 'library31ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var library31Grid = $.fn.dlshouwen.grid.init(library31Option);
$(function () {
  library31Grid.load();
});

// 个人资产申请—资产管理员调配
function tpeople(id) {
  layer.confirm('确认转移此资产？', {
    btn: ['确认', '取消'] //按钮
  }, function () {
    layer.msg('转移成功', {
      icon: 1
    });
  });
}

// 资产库借货管理明细-确认接收
var library03Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '总金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'a',
  title: '拆分单件',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'abuy',
  title: '供货商',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'tel',
  title: '经办人',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 70,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    // content += '<button class="btn btn-xs btn-info" onclick="zdbox(' + record.id + ');"><i class="fa fa-edit"></i>  转移</button>';
    // content += '  ';
    content += '<button class="btn btn-xs btn-success" onclick="ton(' + record.id + ');"><i class="icon-hand-up"></i>  接收</button>';
    return content;
  }
}];
var library03Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产库借货信息',
  datas: [{
    number: '1',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述',
    size: '12',
    price: '￥2222.99元',
    a: '12',
    abuy: '联想',
    tel: '张三',
  }, ],
  columns: library03Columns,
  gridContainer: 'library03Container',
  toolbarContainer: 'library03ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var library03Grid = $.fn.dlshouwen.grid.init(library03Option);
$(function () {
  library03Grid.load();
});


// 资产库借货管理明细-确认验收
var libendColumns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'no',
  title: '资产编号',
  width: 170,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'status',
  title: '状态',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gname',
  title: '归属人',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gpro',
  title: '归属项目',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'address',
  title: '放置地',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 94,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    // content += '<button class="btn btn-xs btn-info" onclick="zdbox(' + record.id + ');"><i class="fa fa-edit"></i>  转移</button>';
    // content += '  ';
    content += '<button class="btn btn-xs btn-success" onclick="ton(' + record.id + ');"><i class="icon-hand-up"></i>  确认验收</button>';
    return content;
  }
}];
var libendOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产库借货信息',
  datas: [{
    id: 1,
    number: '1',
    no: 'NJSTS20180102180222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    status: '闲置',
    gname: '张三',
    gpro: '中国移动',
    address: '南京'
  }, ],
  columns: libendColumns,
  gridContainer: 'libendContainer',
  toolbarContainer: 'libendToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var libendGrid = $.fn.dlshouwen.grid.init(libendOption);
$(function () {
  libendGrid.load();
});

// 购买清单
var libendtColumns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'size',
  title: '数量',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '总金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'a',
  title: '拆分单件',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'abuy',
  title: '供货商',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'tel',
  title: '经办人',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'ftgz',
  title: '购买状态',
  width: 74,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 260,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="down();"><i class="icon-cloud-download"></i>  报价文件</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="down();"><i class="icon-cloud-download"></i>  协议合同</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-success" onclick="shgs();"><i class="icon-ok-sign"></i>  购买确认</button>';
    return content;
  }
}];
var libendtOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '购买清单',
  datas: [{
    number: '1',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述',
    size: '12',
    price: '￥2222.99元',
    a: '12',
    abuy: '联想',
    tel: '张三',
    ftgz: '已购买'
  }, ],
  columns: libendtColumns,
  gridContainer: 'libendtContainer',
  toolbarContainer: 'libendtToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var libendtGrid = $.fn.dlshouwen.grid.init(libendtOption);
$(function () {
  libendtGrid.load();
});




// 采购结果清单
var library04Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'no',
  title: '资产编号',
  width: 170,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'status',
  title: '状态',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gname',
  title: '归属人',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gpro',
  title: '归属项目',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'address',
  title: '放置地',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, ];
var library04Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产库借货信息',
  datas: [{
    id: 1,
    number: '1',
    no: 'NJSTS20180102180222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    status: '闲置',
    gname: '张三',
    gpro: '中国移动',
    address: '南京'
  }, ],
  columns: library04Columns,
  gridContainer: 'library04Container',
  toolbarContainer: 'library04ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var library04Grid = $.fn.dlshouwen.grid.init(library04Option);
$(function () {
  library04Grid.load();
});


// 确认接收资产
function ton(id) {
  layer.confirm('确认接收资产库资源？', {
    btn: ['确认', '取消'] //按钮
  }, function () {
    layer.msg('接收成功', {
      icon: 1
    });
  });
}

// 资产库借货清单-待办102
var library3Columns = [{
  id: 'number',
  title: '序号',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'no',
  title: '资产编号',
  width: 170,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'status',
  title: '状态',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gname',
  title: '归属人',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gpro',
  title: '归属项目',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'address',
  title: '放置地',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 180,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="zdbox1(' + record.id + ');"><i class="icon-retweet"></i>  转换采购</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-success" onclick="ding(' + record.id + ');"><i class="icon-hand-up"></i>  申请预定</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var library3Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '资产库借货信息',
  datas: [{
    id: 1,
    number: '1',
    no: 'NJSTS20180102180222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    status: '闲置',
    gname: '张三',
    gpro: '中国移动',
    address: '南京'
  }, ],
  columns: library3Columns,
  gridContainer: 'library3Container',
  toolbarContainer: 'library3ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var library3Grid = $.fn.dlshouwen.grid.init(library3Option);
$(function () {
  library3Grid.load();
});

// 预定
function ding(id) {
  layer.confirm('是否申请预定此资源？', {
    title: '提示信息',
    btn: ['确认', '取消'] //按钮
  }, function () {
    layer.msg('预定成功', {
      icon: 1
    });
  });
}

// 转换采购
function zdbox1(id) {
  layer.confirm('是否确认采购此资源？', {
    btn: ['确认', '取消'] //按钮
  }, function () {
    layer.msg('转换成功', {
      icon: 1
    });
  });
}


// 结果清单
var endColumns = [{
  id: 'number',
  title: '序号',
  width: 45,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'list',
  title: '资产类目',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'type',
  title: '资产类别',
  width: 73,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'no',
  title: '资产编号',
  width: 170,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '资产描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'status',
  title: '状态',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gname',
  title: '归属人',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'gpro',
  title: '归属项目',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'address',
  title: '放置地',
  width: 75,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 60,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="editast(' + record.id + ');"><i class="fa fa-edit"></i>  办理</button>';
    // content += '  ';
    // content += '<button class="btn btn-xs btn-primary" onclick="selast(' + record.id + ');"><i class="icon-eye-open"></i>  查看</button>';
    return content;
  }
}];
var endOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '结果清单',
  datas: [{
    id: 1,
    number: '1',
    no: 'NJSTS20180102180222',
    list: '硬件',
    type: '笔记本',
    msg: '资产描述测试数据',
    status: '闲置',
    gname: '',
    gpro: '中国移动',
    address: '南京'
  }, ],
  columns: endColumns,
  gridContainer: 'endContainer',
  toolbarContainer: 'endToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var endGrid = $.fn.dlshouwen.grid.init(endOption);
$(function () {
  endGrid.load();
});

// 资产办理
function editast(id) {
  window.location.href = "../../proinfo/edit/edit-assets-2.html" + '?id=' + id;
}